package what.api;

import java.util.HashMap;

public class ApiPackage {
	public String packageName;
	public ApiPackage parent;
	public HashMap<String, ApiPackage> packages = new HashMap<String, ApiPackage>();
	public HashMap<String, ApiClass> classes = new HashMap<String, ApiClass>();
	public int nClasses = 0, nMethods = 0;
	
	public ApiPackage(ApiPackage parent, String name) {
		this.parent = parent;
		this.packageName = name;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((packageName == null) ? 0 : packageName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ApiPackage other = (ApiPackage) obj;
		if (packageName == null) {
			if (other.packageName != null)
				return false;
		} else if (!packageName.equals(other.packageName))
			return false;
		return true;
	}
	
	
}
